
function tips ( { message='已复制优惠口令，打开淘宝APP可领', type = 'success'} = {} ) {
    let html = document.createElement("div")
    html.innerHTML = `<div class="web-message show-message message-${type}">${message}</div>`;
	document.body.append(html);
	setTimeout(function () {
        document.body.removeChild(html)
	},1500);
}

function loadJS( url, callback ){
    let script = document.createElement('script'),
    f = callback || function(){};
    script.type = 'text/javascript';
    //IE
    if(script.readyState){
        script.onreadystatechange = function(){
            if( script.readyState == 'loaded' || script.readyState == 'complete' ){
                script.onreadystatechange = null;
                f();
            }
        };

    }else{
        //其他浏览器
        script.onload = function(){
            f();
        };
    }
    script.src = url;
    document.getElementsByTagName('head')[0].appendChild(script);
}



